package cn.wuxun.user.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import redis.clients.jedis.Jedis;
@Configuration
@ConditionalOnClass({Jedis.class})
@ConfigurationProperties(prefix="spring.redis.JedisBeanFactory")
public class JedisBeanFactory {
	private String ServerIP;
	private int port;
	public String getServerIP() {
		return ServerIP;
	}
	public void setServerIP(String serverIP) {
		ServerIP = serverIP;
	}
	public int getPort() {
		return port;
	}
	public void setPort(int port) {
		this.port = port;
	}
	@Bean
	public Jedis createJedis(){
		return new Jedis(ServerIP,port);
		
	}
}
